package com.kxf.androidtestdemo.activity;

import android.os.RemoteException;

import com.kxf.androidtestdemo.IMyAidlInterface;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;

public class IMyAidlInterfaceImpl extends IMyAidlInterface.Stub {
    @Override
    public String getString(String aString) throws RemoteException {
        File file = new File("/sdcard/a.txt");
        try {
            FileOutputStream outputStream = new FileOutputStream(file);
            outputStream.write("kuangxf".getBytes());
            outputStream.flush();
            //强制文件系统刷新
            outputStream.getFD().sync();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
